package org.gap.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import java.util.Calendar;
import java.util.Set;

import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAllCaractPPs", query = "select myCaractPP from CaractPP myCaractPP"),
		@NamedQuery(name = "findNomPers", query = "select cppNomPers from CaractPP"),
		@NamedQuery(name = "findCaractPPByCppCodeProfession", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppCodeProfession = ?1"),
		@NamedQuery(name = "findCaractPPByCppCodeProfessionContaining", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppCodeProfession like ?1"),
		@NamedQuery(name = "findCaractPPByCppCsp", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppCsp = ?1"),
		@NamedQuery(name = "findCaractPPByCppDateEtatPhysique", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppDateEtatPhysique = ?1"),
		@NamedQuery(name = "findCaractPPByCppDateEtatPhysiqueAfter", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppDateEtatPhysique > ?1"),
		@NamedQuery(name = "findCaractPPByCppDateEtatPhysiqueBefore", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppDateEtatPhysique < ?1"),
		@NamedQuery(name = "findCaractPPByCppDateNaissance", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppDateNaissance = ?1"),
		@NamedQuery(name = "findCaractPPByCppDateNaissanceAfter", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppDateNaissance > ?1"),
		@NamedQuery(name = "findCaractPPByCppDateNaissanceBefore", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppDateNaissance < ?1"),
		@NamedQuery(name = "findCaractPPByCppDateSituation", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppDateSituation = ?1"),
		@NamedQuery(name = "findCaractPPByCppDateSituationAfter", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppDateSituation > ?1"),
		@NamedQuery(name = "findCaractPPByCppDateSituationBefore", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppDateSituation < ?1"),
		@NamedQuery(name = "findCaractPPByCppEtatPhysique", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppEtatPhysique = ?1"),
		@NamedQuery(name = "findCaractPPByCppEtatPhysiqueContaining", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppEtatPhysique like ?1"),
		@NamedQuery(name = "findCaractPPByCppNif", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppNif = ?1"),
		@NamedQuery(name = "findCaractPPByCppNomJeuneFille", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppNomJeuneFille = ?1"),
		@NamedQuery(name = "findCaractPPByCppNomJeuneFilleContaining", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppNomJeuneFille like ?1"),
		@NamedQuery(name = "findCaractPPByCppNomPers", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppNomPers = ?1"),
		@NamedQuery(name = "findCaractPPByCppNomPersContaining", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppNomPers like ?1"),
		@NamedQuery(name = "findCaractPPByCppNombreEnfants", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppNombreEnfants = ?1"),
		@NamedQuery(name = "findCaractPPByCppPrenomPers", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppPrenomPers = ?1"),
		@NamedQuery(name = "findCaractPPByCppPrenomPersContaining", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppPrenomPers like ?1"),
		@NamedQuery(name = "findCaractPPByCppQualite", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppQualite = ?1"),
		@NamedQuery(name = "findCaractPPByCppQualiteContaining", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppQualite like ?1"),
		@NamedQuery(name = "findCaractPPByCppRegimeSocial", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppRegimeSocial = ?1"),
		@NamedQuery(name = "findCaractPPByCppRegimeSocialContaining", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppRegimeSocial like ?1"),
		@NamedQuery(name = "findCaractPPByCppSexe", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppSexe = ?1"),
		@NamedQuery(name = "findCaractPPByCppSexeContaining", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppSexe like ?1"),
		@NamedQuery(name = "findCaractPPByCppSituationFamille", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppSituationFamille = ?1"),
		@NamedQuery(name = "findCaractPPByCppSituationFamilleContaining", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppSituationFamille like ?1"),
		@NamedQuery(name = "findCaractPPByCppTiers", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppTiers = ?1"),
		@NamedQuery(name = "findCaractPPByPrimaryKey", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppTiers = ?1"), 
		@NamedQuery(name = "findCaractPPByCppNomPersAndPrenomPers", query = "select myCaractPP from CaractPP myCaractPP where myCaractPP.cppNomPers like ?1 or myCaractPP.cppPrenomPers like ?1")
})
@Table(schema = "GAP", name = "CARACT_P_P")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "GAP_v2/org/gap/domain", name = "CaractPP")
public class CaractPP implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "CPP_TIERS", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	Integer cppTiers;
	/**
	 */

	@Column(name = "CPP_SEXE", length = 1)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cppSexe;
	/**
	 */

	@Column(name = "CPP_QUALITE", length = 2)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cppQualite;
	/**
	 */

	@Column(name = "CPP_NOM_PERS", length = 50)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cppNomPers;
	/**
	 */

	@Column(name = "CPP_PRENOM_PERS", length = 50)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cppPrenomPers;
	/**
	 */

	@Column(name = "CPP_NOM_JEUNE_FILLE", length = 50)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cppNomJeuneFille;
	/**
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "CPP_DATE_NAISSANCE")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar cppDateNaissance;
	/**
	 */

	@Column(name = "CPP_CSP")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Integer cppCsp;
	/**
	 */

	@Column(name = "CPP_REGIME_SOCIAL", length = 1)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cppRegimeSocial;
	/**
	 */

	@Column(name = "CPP_CODE_PROFESSION", length = 6)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cppCodeProfession;
	/**
	 */

	@Column(name = "CPP_SITUATION_FAMILLE", length = 6)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cppSituationFamille;
	/**
	 */

	@Column(name = "CPP_NOMBRE_ENFANTS")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Integer cppNombreEnfants;
	/**
	 */

	@Column(name = "CPP_NIF")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Integer cppNif;
	/**
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "CPP_DATE_SITUATION")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar cppDateSituation;
	/**
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "CPP_DATE_ETAT_PHYSIQUE")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar cppDateEtatPhysique;
	/**
	 */

	@Column(name = "CPP_ETAT_PHYSIQUE", length = 3)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cppEtatPhysique;

	/**
	 */
	@PrimaryKeyJoinColumn
	@OneToOne(fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	Tiers tiers;

	/**
	 */
	public void setCppTiers(Integer cppTiers) {
		this.cppTiers = cppTiers;
	}

	/**
	 */
	public Integer getCppTiers() {
		return this.cppTiers;
	}

	/**
	 */
	public void setCppSexe(String cppSexe) {
		this.cppSexe = cppSexe;
	}

	/**
	 */
	public String getCppSexe() {
		return this.cppSexe;
	}

	/**
	 */
	public void setCppQualite(String cppQualite) {
		this.cppQualite = cppQualite;
	}

	/**
	 */
	public String getCppQualite() {
		return this.cppQualite;
	}

	/**
	 */
	public void setCppNomPers(String cppNomPers) {
		this.cppNomPers = cppNomPers;
	}

	/**
	 */
	public String getCppNomPers() {
		return this.cppNomPers;
	}

	/**
	 */
	public void setCppPrenomPers(String cppPrenomPers) {
		this.cppPrenomPers = cppPrenomPers;
	}

	/**
	 */
	public String getCppPrenomPers() {
		return this.cppPrenomPers;
	}

	/**
	 */
	public void setCppNomJeuneFille(String cppNomJeuneFille) {
		this.cppNomJeuneFille = cppNomJeuneFille;
	}

	/**
	 */
	public String getCppNomJeuneFille() {
		return this.cppNomJeuneFille;
	}

	/**
	 */
	public void setCppDateNaissance(Calendar cppDateNaissance) {
		this.cppDateNaissance = cppDateNaissance;
	}

	/**
	 */
	public Calendar getCppDateNaissance() {
		return this.cppDateNaissance;
	}

	/**
	 */
	public void setCppCsp(Integer cppCsp) {
		this.cppCsp = cppCsp;
	}

	/**
	 */
	public Integer getCppCsp() {
		return this.cppCsp;
	}

	/**
	 */
	public void setCppRegimeSocial(String cppRegimeSocial) {
		this.cppRegimeSocial = cppRegimeSocial;
	}

	/**
	 */
	public String getCppRegimeSocial() {
		return this.cppRegimeSocial;
	}

	/**
	 */
	public void setCppCodeProfession(String cppCodeProfession) {
		this.cppCodeProfession = cppCodeProfession;
	}

	/**
	 */
	public String getCppCodeProfession() {
		return this.cppCodeProfession;
	}

	/**
	 */
	public void setCppSituationFamille(String cppSituationFamille) {
		this.cppSituationFamille = cppSituationFamille;
	}

	/**
	 */
	public String getCppSituationFamille() {
		return this.cppSituationFamille;
	}

	/**
	 */
	public void setCppNombreEnfants(Integer cppNombreEnfants) {
		this.cppNombreEnfants = cppNombreEnfants;
	}

	/**
	 */
	public Integer getCppNombreEnfants() {
		return this.cppNombreEnfants;
	}

	/**
	 */
	public void setCppNif(Integer cppNif) {
		this.cppNif = cppNif;
	}

	/**
	 */
	public Integer getCppNif() {
		return this.cppNif;
	}

	/**
	 */
	public void setCppDateSituation(Calendar cppDateSituation) {
		this.cppDateSituation = cppDateSituation;
	}

	/**
	 */
	public Calendar getCppDateSituation() {
		return this.cppDateSituation;
	}

	/**
	 */
	public void setCppDateEtatPhysique(Calendar cppDateEtatPhysique) {
		this.cppDateEtatPhysique = cppDateEtatPhysique;
	}

	/**
	 */
	public Calendar getCppDateEtatPhysique() {
		return this.cppDateEtatPhysique;
	}

	/**
	 */
	public void setCppEtatPhysique(String cppEtatPhysique) {
		this.cppEtatPhysique = cppEtatPhysique;
	}

	/**
	 */
	public String getCppEtatPhysique() {
		return this.cppEtatPhysique;
	}

	/**
	 */
	public void setTiers(Tiers tiers) {
		this.tiers = tiers;
	}

	/**
	 */
	public Tiers getTiers() {
		return tiers;
	}

	/**
	 */
	public CaractPP() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(CaractPP that) {
		setCppTiers(that.getCppTiers());
		setCppSexe(that.getCppSexe());
		setCppQualite(that.getCppQualite());
		setCppNomPers(that.getCppNomPers());
		setCppPrenomPers(that.getCppPrenomPers());
		setCppNomJeuneFille(that.getCppNomJeuneFille());
		setCppDateNaissance(that.getCppDateNaissance());
		setCppCsp(that.getCppCsp());
		setCppRegimeSocial(that.getCppRegimeSocial());
		setCppCodeProfession(that.getCppCodeProfession());
		setCppSituationFamille(that.getCppSituationFamille());
		setCppNombreEnfants(that.getCppNombreEnfants());
		setCppNif(that.getCppNif());
		setCppDateSituation(that.getCppDateSituation());
		setCppDateEtatPhysique(that.getCppDateEtatPhysique());
		setCppEtatPhysique(that.getCppEtatPhysique());
		setTiers(that.getTiers());
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("cppTiers=[").append(cppTiers).append("] ");
		buffer.append("cppSexe=[").append(cppSexe).append("] ");
		buffer.append("cppQualite=[").append(cppQualite).append("] ");
		buffer.append("cppNomPers=[").append(cppNomPers).append("] ");
		buffer.append("cppPrenomPers=[").append(cppPrenomPers).append("] ");
		buffer.append("cppNomJeuneFille=[").append(cppNomJeuneFille).append("] ");
		buffer.append("cppDateNaissance=[").append(cppDateNaissance).append("] ");
		buffer.append("cppCsp=[").append(cppCsp).append("] ");
		buffer.append("cppRegimeSocial=[").append(cppRegimeSocial).append("] ");
		buffer.append("cppCodeProfession=[").append(cppCodeProfession).append("] ");
		buffer.append("cppSituationFamille=[").append(cppSituationFamille).append("] ");
		buffer.append("cppNombreEnfants=[").append(cppNombreEnfants).append("] ");
		buffer.append("cppNif=[").append(cppNif).append("] ");
		buffer.append("cppDateSituation=[").append(cppDateSituation).append("] ");
		buffer.append("cppDateEtatPhysique=[").append(cppDateEtatPhysique).append("] ");
		buffer.append("cppEtatPhysique=[").append(cppEtatPhysique).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((cppTiers == null) ? 0 : cppTiers.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof CaractPP))
			return false;
		CaractPP equalCheck = (CaractPP) obj;
		if ((cppTiers == null && equalCheck.cppTiers != null) || (cppTiers != null && equalCheck.cppTiers == null))
			return false;
		if (cppTiers != null && !cppTiers.equals(equalCheck.cppTiers))
			return false;
		return true;
	}
}
